Miscellaneous tidying up, no semantic changes.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 19:48:54 +0000 (19:48 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 30 Nov 2005 19:48:54 +0000 (19:48 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendCheckpoint.py
tools/python/xen/xend/XendProtocol.py
tools/python/xen/xend/XendRoot.py
tools/python/xen/xend/server/netif.py
tools/python/xen/xend/server/relocate.py
tools/python/xen/xend/tests/test_sxp.py
tools/python/xen/xend/uuid.py

index a50a7b2cff77fd9ce46564e0b3105f2335671af7..06c51ee417522220836df36ea896fb630130d45f 100644 (file)
@@ -18,8 +18,6 @@ import xen.util.auxbin
 
 import xen.lowlevel.xc
 
-from xen.xend.xenstore.xsutil import IntroduceDomain
-
 from XendError import XendError
 from XendLogging import log
 
index 503af1d38bfcc7cc3b92359ab4ab718cba5a3a2e..20b61495770411acdc6fc5fd90c073b21ebdbab6 100644 (file)
@@ -100,7 +100,7 @@ class XendClientProtocol:
         """
         return self.xendRequest(url, "POST", args)
 
-    def handleStatus(self, version, status, message):
+    def handleStatus(self, _, status, message):
         """Handle the status returned from the request.
         """
         status = int(status)
@@ -114,8 +114,8 @@ class XendClientProtocol:
         """Handle the data returned in response to the request.
         """
         if data is None: return None
-        type = self.getHeader('Content-Type')
-        if type != sxp.mime_type:
+        typ = self.getHeader('Content-Type')
+        if typ != sxp.mime_type:
             return data
         try:
             pin = sxp.Parser()
@@ -205,5 +205,5 @@ class UnixXendClientProtocol(HttpXendClientProtocol):
             path = xroot.get_xend_unix_path()
         self.path = path
 
-    def makeConnection(self, url):
+    def makeConnection(self, _):
         return UnixConnection(self.path)
index d94f63a58d0beceeafbbd124c799462961848075..b61532737a6af3c3a196d7561ec9a7e39ff8262f 100644 (file)
@@ -171,7 +171,7 @@ class XendRoot:
         v = self.get_config_value(name, val)
         try:
             return int(v)
-        except Exception, ex:
+        except Exception:
             raise XendError("invalid xend config %s: expected int: %s" % (name, v))
 
     def get_xend_http_server(self):
index 14b079fdbb9218594a7942c6d318ef53c5a0d582..9269d83ae002518cad8e158aa6c4a5b784acc5b7 100644 (file)
@@ -71,8 +71,8 @@ class NetifController(DevController):
         script = os.path.join(xroot.network_script_dir,
                               sxp.child_value(config, 'script',
                                               xroot.get_vif_script()))
-        type = sxp.child_value(config, 'type')
-        if type == 'ioemu':
+        typ = sxp.child_value(config, 'type')
+        if typ == 'ioemu':
             return (None,{},{})
         bridge = sxp.child_value(config, 'bridge')
         mac    = sxp.child_value(config, 'mac')
index c179eaf6f76fa6c5fbdfa317d16205850d8d83ae..d4480f242ed31cba03302949952d1942d892c354 100644 (file)
@@ -16,7 +16,6 @@
 # Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
-import socket
 import sys
 import StringIO
 
index b0200b72ccbb3b350380c3d969642fc12ef56ca3..aad8161f10abf1872a97cd0f241285cbf2d9f9dd 100644 (file)
@@ -6,8 +6,8 @@ import xen.xend.sxp
 class test_sxp(unittest.TestCase):
 
     def testAllFromString(self):
-        def t(input, expected):
-            self.assertEqual(xen.xend.sxp.all_from_string(input), expected)
+        def t(inp, expected):
+            self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)
 
         t('String',           ['String'])
         t('(String Thing)',   [['String', 'Thing']])
index c471067fdd9c181cb6402dc7c6fe155405816bfb..2bf514c67d724e9949ec8f8555cd760516eb54c0 100644 (file)
@@ -25,14 +25,14 @@ import commands
 import random
 
 
-def getUuidUuidgen(random = True):
+def getUuidUuidgen(randomly = True):
     """Generate a UUID using the command uuidgen.
 
-    If random is true (default) generates a random uuid.
-    If random is false generates a time-based uuid.
+    If randomly is true (default) generates a random uuid.
+    If randomly is false generates a time-based uuid.
     """
     cmd = "uuidgen"
-    if random:
+    if randomly:
         cmd += " -r"
     else:
         cmd += " -t"
@@ -42,7 +42,7 @@ def getUuidUuidgen(random = True):
 def getUuidRandom():
     """Generate a random UUID."""
     
-    return [ random.randint(0, 255) for i in range(0, 16) ]
+    return [ random.randint(0, 255) for _ in range(0, 16) ]
 
 
 #uuidFactory = getUuidUuidgen